#import "AddressAnnotation.h"

@implementation AddressAnnotation

@synthesize coordinate = annCoordinate;

//retrieves map annotation with a coordinate parameter
+ (AddressAnnotation *)mapAnnotationWithCoordinate:(CLLocationCoordinate2D)coordinate {
	return [[self alloc] initWithCoordinate:coordinate];
}

//retrieves map annotation with a coordinate and title
+ (AddressAnnotation *)mapAnnotationWithCoordinate:(CLLocationCoordinate2D)coordinate andTitle:(NSString *)title {
	return [[self alloc] initWithCoordinate:coordinate andTitle:title];
}

//retrieves a map annotation with a coordinate, title and subtitle
+ (AddressAnnotation *)mapAnnotationWithCoordinate:(CLLocationCoordinate2D)coordinate andTitle:(NSString *)title andSubtitle:(NSString *)subtitle {
	return [[self alloc] initWithCoordinate:coordinate andTitle:title andSubtitle:subtitle];
}


- (id) initWithCoordinate:(CLLocationCoordinate2D)coordinate {
    annCoordinate = coordinate;
	
    return self;
}

- (id) initWithCoordinate:(CLLocationCoordinate2D)coordinate andTitle:(NSString*) title {
    annCoordinate = coordinate;
    annTitle = [title retain];
	
    return self;
}

- (id) initWithCoordinate:(CLLocationCoordinate2D)coordinate andTitle:(NSString*) title andSubtitle:(NSString*) subtitle {
    annCoordinate = coordinate;
    annTitle = [title retain];
    annSubtitle = [subtitle retain];
	
    return self;
}

- (NSString *)title {
    return annTitle;
}

- (NSString *)subtitle {
    return annSubtitle;
}

-(void) dealloc {
    [annTitle release];
    [annSubtitle release];
    [super dealloc];
}

@end